﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace Common
{
    public class ChiTietDonHang
    {
        public int iChiTietDongHang_ID { get; set; }
        public int iDonHang_ID { get; set; }
        public int iDanhMucHangHoa_ID { get; set; }
        public int iSoLuong { get; set; }
        public decimal dGiaBan { get; set; }
        public ChiTietDonHang()
        {

        }
        public ChiTietDonHang(SqlDataReader reader)
        {
            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) this.iChiTietDongHang_ID = Convert.ToInt32(reader["iChiTietDongHang_ID"]);
                if (!reader.IsDBNull(1)) this.iDonHang_ID = Convert.ToInt32(reader["iDonHang_ID"]);
                if (!reader.IsDBNull(2)) this.iDanhMucHangHoa_ID = Convert.ToInt32(reader["iDanhMucHangHoa_ID"]);
                if (!reader.IsDBNull(3)) this.iSoLuong = Convert.ToInt32(reader["iSoLuong"]);
                if (!reader.IsDBNull(4)) this.dGiaBan = Convert.ToDecimal(reader["dGiaBan"]);

            }
            reader.Close();
            reader.Dispose();
        }
    }
}
